unit PrinterDPI;

interface

uses
  Database,
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Buttons, Mask, JvExMask, JvSpin,
  JvDBSpinEdit;

type
  TFormPrinterDPI = class(TForm)
    Label1: TLabel;
    BtnOK: TBitBtn;
    BtnCancel: TBitBtn;
    SpinDPI: TJvDBSpinEdit;
    procedure BtnCancelClick(Sender: TObject);
    procedure BtnOKClick(Sender: TObject);
    procedure EditDPIKeyPress(Sender: TObject; var Key: Char);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FormPrinterDPI: TFormPrinterDPI;

implementation

{$R *.DFM}

procedure TFormPrinterDPI.BtnCancelClick(Sender: TObject);
begin
  close;
end;

procedure TFormPrinterDPI.EditDPIKeyPress(Sender: TObject;
  var Key: Char);
begin
  if key = #13 then begin
    BtnOK.click;
    key:=#0;
  end;
end;

procedure TFormPrinterDPI.BtnOKClick(Sender: TObject);
begin
  with Datawell.TableMaps do begin
    edit;
    fieldbyname('I1').asinteger:=trunc(SpinDPI.value);
    post;
  end;
  close;
end;

end.
